const express = require("express");
const app = express();

/* app.use(express.json())
app.use(express.urlencoded())

app.post('/form',(req,res)=>{
    console.log(req.body);
    res.send(req.body)
})

app.get('/home',(req,res)=>{
    res.send({name:'home'})
}) */

/* app.use(express.json())
app.use(express.urlencoded())

app.post('/form',(req,res)=>{
    console.log(req.body)
    res.send(req.body)
})

app.get('/home',(req,res)=>{
    res.send({name:'home'})
}) */

app.use(express.json());
app.use(express.urlencoded());

app.post("/form", (req, res) => {
  console.log(req.body);
  res.send(req.body);
});

app.get("/home", (req, res) => {
  res.send({ name: "home", msg: "express" });
});

app.listen(8080, () => {
  console.log("8080 running");
});
